using System;
using LinFu.Proxy;
using LinFu.Proxy.Interfaces;

namespace ComponentTracer
{
    public static class TracerProxy
    {
        public static T Create<T>(T component, Action<string> tracer) {
            var proxyFactory = new ProxyFactory();
            return proxyFactory.CreateProxy<T>(new TraceInterceptor(component, tracer));
        }

        public static object Create(Type type, object component, Action<string> tracer) {
            var proxyFactory = new ProxyFactory();
            return proxyFactory.CreateProxy(type, new TraceInterceptor(component, tracer));
        }
    }
}